package com.kang.service.userService;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kang.bean.Dialogue;
import com.kang.commons.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient("springcloud-zuul") //调用的服务名称  spring。application。name的值
@RequestMapping("/fawu/user-api/dialogue")
@Service
public interface DialogueService{

    @PostMapping("/saveDialogue")
    void saveDialogue(@RequestParam Long fromUserId, @RequestParam Long toUserId, @RequestParam String msg,
                      @RequestParam int msgType, @RequestParam int type, @RequestParam int isRead);

    @PostMapping("/getNotReadDialogue")
    List<Dialogue> getNotReadDialogue(@RequestParam Long fromUserId, @RequestParam Long toUserId);

    @PostMapping("/saveRead")
    void saveRead(List<Dialogue> list);

    @GetMapping("/{toUserId}")
    Result getHistorIcalNews(@PathVariable("toUserId") Long toUserId);
}
